import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { PermissionTypeEnum } from '../entities/permission.entity';

export class CreatePermissionDto {
  @ApiProperty({
    type: String,
    description: '前端权限显示名称',
    default: 'permission',
  })
  readonly title: string;

  @ApiPropertyOptional({
    type: 'enum',
    description: '权限类型',
    default: PermissionTypeEnum.MENU,
  })
  readonly type?: PermissionTypeEnum;

  @ApiPropertyOptional({
    type: String,
    description: '菜单名',
    default: '',
  })
  readonly name?: string;

  @ApiPropertyOptional({
    type: String,
    description: '菜单名',
    default: '',
  })
  readonly icon?: string;

  @ApiPropertyOptional({
    type: String,
    description: '菜单或链接路径',
    default: '',
  })
  readonly path?: string;

  @ApiPropertyOptional({
    type: String,
    description: '前端组件对应位置',
    default: '',
  })
  readonly component?: string;

  public id?: string;

  public parentId?: string;
}
